﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;

using XCode;
using BingZi.HY.Core;

namespace BingZi.HY.Core
{
	/// <summary>
	/// 部门
	/// </summary>
	[Serializable]
	[DataObject]
	[Description("部门")]
	[BindTable("sys_Group", Description = "部门", ConnName = "System")]
	public partial class sys_Group
	{
		#region 属性
		private Int32 _GroupID;
		/// <summary>
		/// 分类ID号
		/// </summary>
		[Description("分类ID号")]
		[DataObjectField(true, true, false, 10)]
		[BindColumn(1, "GroupID", "分类ID号", "", "int", 10, 0, false)]
		public Int32 GroupID
		{
			get { return _GroupID; }
			set { if (OnPropertyChanging("GroupID", value)) { _GroupID = value;   } }
		}

		private String _G_CName;
		/// <summary>
		/// 分类中文说明
		/// </summary>
		[Description("分类中文说明")]
		[DataObjectField(false, false, true, 50)]
		[BindColumn(2, "G_CName", "分类中文说明", "", "nvarchar(50)", 0, 0, true)]
		public String G_CName
		{
			get { return _G_CName; }
			set { if (OnPropertyChanging("G_CName", value)) { _G_CName = value;   } }
		}

		private Int32 _G_ParentID;
		/// <summary>
		/// 上级分类ID0:为最高级
		/// </summary>
		[Description("上级分类ID0:为最高级")]
		[DataObjectField(false, false, false, 10)]
		[BindColumn(3, "G_ParentID", "上级分类ID0:为最高级", "0", "int", 10, 0, false)]
		public Int32 G_ParentID
		{
			get { return _G_ParentID; }
			set { if (OnPropertyChanging("G_ParentID", value)) { _G_ParentID = value;   } }
		}

		private Int32 _G_ShowOrder;
		/// <summary>
		/// 显示顺序
		/// </summary>
		[Description("显示顺序")]
		[DataObjectField(false, false, false, 10)]
		[BindColumn(4, "G_ShowOrder", "显示顺序", "0", "int", 10, 0, false)]
		public Int32 G_ShowOrder
		{
			get { return _G_ShowOrder; }
			set { if (OnPropertyChanging("G_ShowOrder", value)) { _G_ShowOrder = value;   } }
		}

		private Int32 _G_Level;
		/// <summary>
		/// 当前分类所在层数
		/// </summary>
		[Description("当前分类所在层数")]
		[DataObjectField(false, false, true, 10)]
		[BindColumn(5, "G_Level", "当前分类所在层数", "", "int", 10, 0, false)]
		public Int32 G_Level
		{
			get { return _G_Level; }
			set { if (OnPropertyChanging("G_Level", value)) { _G_Level = value;   } }
		}

		private Int32 _G_ChildCount;
		/// <summary>
		/// 当???分类子分类数
		/// </summary>
		[Description("当???分类子分类数")]
		[DataObjectField(false, false, true, 10)]
		[BindColumn(6, "G_ChildCount", "当???分类子分类数", "", "int", 10, 0, false)]
		public Int32 G_ChildCount
		{
			get { return _G_ChildCount; }
			set { if (OnPropertyChanging("G_ChildCount", value)) { _G_ChildCount = value;   } }
		}

        private Int32 _G_Delete;
		/// <summary>
		/// 是否删除1:是0:否
		/// </summary>
		[Description("是否删除1:是0:否")]
		[DataObjectField(false, false, true, 3)]
		[BindColumn(7, "G_Delete", "是否删除1:是0:否", "", "tinyint", 3, 0, false)]
        public Int32 G_Delete
		{
			get { return _G_Delete; }
			set { if (OnPropertyChanging("G_Delete", value)) { _G_Delete = value;   } }
		}
		#endregion

		#region 获取/设置 字段值
		/// <summary>
		/// 获取/设置 字段值。
		/// 一个索引，基类使用反射实现。
		/// 派生实体类可重写该索引，以避免反射带来的性能损耗
		/// </summary>
		/// <param name="name">字段名</param>
		/// <returns></returns>
		public override Object this[String name]
		{
			get
			{
				switch (name)
				{
					case "GroupID" : return _GroupID;
					case "G_CName" : return _G_CName;
					case "G_ParentID" : return _G_ParentID;
					case "G_ShowOrder" : return _G_ShowOrder;
					case "G_Level" : return _G_Level;
					case "G_ChildCount" : return _G_ChildCount;
					case "G_Delete" : return _G_Delete;
					default: return base[name];
				}
			}
			set
			{
				switch (name)
				{
					case "GroupID" : _GroupID = Convert.ToInt32(value); break;
					case "G_CName" : _G_CName = Convert.ToString(value); break;
					case "G_ParentID" : _G_ParentID = Convert.ToInt32(value); break;
					case "G_ShowOrder" : _G_ShowOrder = Convert.ToInt32(value); break;
					case "G_Level" : _G_Level = Convert.ToInt32(value); break;
					case "G_ChildCount" : _G_ChildCount = Convert.ToInt32(value); break;
                    case "G_Delete": _G_Delete = Convert.ToInt32(value); break;
					default: base[name] = value; break;
				}
			}
		}
		#endregion

		#region 字段名
		/// <summary>
		/// 取得部门字段名的快捷方式
		/// </summary>
        [CLSCompliant(false)]
		public class _
		{
			///<summary>
			/// 分类ID号
			///</summary>
			public const String GroupID = "GroupID";

			///<summary>
			/// 分类中文说明
			///</summary>
			public const String G_CName = "G_CName";

			///<summary>
			/// 上级分类ID0:为最高级
			///</summary>
			public const String G_ParentID = "G_ParentID";

			///<summary>
			/// 显示顺序
			///</summary>
			public const String G_ShowOrder = "G_ShowOrder";

			///<summary>
			/// 当前分类所在层数
			///</summary>
			public const String G_Level = "G_Level";

			///<summary>
			/// 当???分类子分类数
			///</summary>
			public const String G_ChildCount = "G_ChildCount";

			///<summary>
			/// 是否删除1:是0:否
			///</summary>
			public const String G_Delete = "G_Delete";
		}
		#endregion
	}
}